Head over to the support website down below and follow the steps outlined there. Note that a name change is a one-time only thing, so choose your new agent ...
Codename changes are only allowed for players that accidentally input their real name or their activation code. Request a codename change via the Ingress Help ...